]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ripples: Remove unreachable return statements
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 29 Jun 2019 12:36:13 +0000 (14:36 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 1 Jul 2019 21:09:49 +0000 (21:09 +0000)
Throwing an exception stops execution of the current function,
so the following return statements are both unnecessary and
unreachable.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606

js/ui/ripples.js

index 37d7362deef788dcf1326750141164ca89f92dca..96abe181a435054944d3c0994d412dd290166f93 100644 (file)
@@ -61,10 +61,8 @@ var Ripples = class Ripples {
     }
 
     addTo(stage) {
-        if (this._stage !== undefined) {
+        if (this._stage !== undefined)
             throw new Error('Ripples already added');
-            return;
-        }
 
         this._stage = stage;
         this._stage.add_actor(this._ripple1);
@@ -73,10 +71,8 @@ var Ripples = class Ripples {
     }
 
     playAnimation(x, y) {
-        if (this._stage === undefined) {
+        if (this._stage === undefined)
             throw new Error('Ripples not added');
-            return;
-        }
 
         this._x = x;
         this._y = y;